<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core">
    <h:head>
        <title>Users</title>
    </h:head>
    <body>
        <ui:composition template="../../templates/admin/template.xhtml"> 
            <ui:define name="content">
                <p>Users</p>
                <f:view>
                    <h:form>
                        <h1><h:outputText value="List"/></h1>
                        <h:dataTable value="#{adminUserBean.getAllUsers()}" var="item">
                            <h:column>
                                <f:facet name="header">
                                    <h:outputText value="Id"/>
                                </f:facet>
                                <h:outputText value="#{item.id}"/>
                            </h:column>
                            <h:column>
                                <f:facet name="header">
                                    <h:outputText value="Name"/>
                                </f:facet>
                                <h:outputText value="#{item.name}"/>
                            </h:column>
                            <h:column>
                                <f:facet name="header">
                                    <h:outputText value="LastName"/>
                                </f:facet>
                                <h:outputText value="#{item.lastName}"/>
                            </h:column>
                            <h:column>
                                <f:facet name="header">
                                    <h:outputText value="Email"/>
                                </f:facet>
                                <h:outputText value="#{user.email}"/>
                            </h:column>
                            <h:column>
                                <f:facet name="header">
                                    <h:outputText value="Gender"/>
                                </f:facet>
                                <h:outputText value="#{item.gender}"/>
                            </h:column>
                            <h:column>
                                <f:facet name="header">
                                    <h:outputText value="Date of birth"/>
                                </f:facet>
                                <h:outputText value="#{item.dateOfBirth}"/>
                            </h:column>
                            <h:column>
                                <f:facet name="header">
                                    <h:outputText value="Registered"/>
                                </f:facet>
                                <h:outputText value="#{item.registered}">
                                    <f:convertDateTime pattern="MM/dd/yyyy HH:mm:ss" />
                                </h:outputText>
                            </h:column>
                            <h:column>
                                <f:facet name="header">
                                    <h:outputText value="Photo"/>
                                </f:facet>
                                <h:outputText value="#{item.photo}"/>
                            </h:column>
                            <h:column>
                                <f:facet name="header">
                                    <h:outputText value="Active"/>
                                </f:facet>
                                <h:outputText value="#{item.active}"/>
                            </h:column>
                            <h:column>
                                <f:facet name="header">
                                    <h:outputText value="Options"/>
                                </f:facet>
                                 <h:commandLink value="Delete"
                                                action="#{adminUserBean.deleteUser}" />
"                            </h:column>
                        </h:dataTable>
                    </h:form>
                </f:view>

            </ui:define>
        </ui:composition>    
    </body>
</html>

